title: “Project proposal” <<<<<<< HEAD author: “Not our names”, aka Delphine, Reese and Kristin output: github_document
library(tidyverse)
library(broom)
library(readr)
Topic: Exploring Variation in Recorded Cod Landings in the U.S. From 1950 to 2021 Guiding Question: How have recorded U.S. Atlantic and Pacific Cod Landings varied since 1950?
For our final project, we have chosen to analyze a dataset titled “Atlantic and Pacific Cod Landings (1950-2021). Using this dataset, we plan to create representations of historical Cod landings in the Atlantic and the Pacific (each individually), so we are able to visualize and interpret the changing trends present in this dataset. These data were compiled by NOAA, and collected from various different sources listed in their own column in our dataset. The variables for our dataset originally include: Year, State, NMFS Name, # Pounds, # Metric Tons, # Dollars, Collection, Scientific Name, # TSN, and Source.
cod_landings <- read_csv("../data/cod-landings.csv")
## Rows: 1196 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (5): State, NMFS Name, Collection, Scientific Name, Source
## dbl (2): Year, Tsn
## num (3): Pounds, Metric Tons, Dollars
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
cod_landings <- cod_landings
names(cod_landings)[names(cod_landings) == "NMFS Name"] <- "Common_Name"
names(cod_landings)[names(cod_landings) == "Metric Tons"] <- "Metric_Tons"
names(cod_landings)[names(cod_landings) == "Dollars"] <- "US_Dollars"
names(cod_landings)[names(cod_landings) == "Scientific Name"] <- "Scientific_Name"
names(cod_landings)[names(cod_landings) == "Collection"] <- "Fishing_Types"
names(cod_landings)[names(cod_landings) == "Tsn"] <- "Taxonomic_Serial_Number"
names(cod_landings)[names(cod_landings) == "Source"] <- "Fishing_Companies"
colnames(cod_landings)
## [1] "Year" "State"
## [3] "Common_Name" "Pounds"
## [5] "Metric_Tons" "US_Dollars"
## [7] "Fishing_Types" "Scientific_Name"
## [9] "Taxonomic_Serial_Number" "Fishing_Companies"
This glimpse represents our data set with modified names to allow a better understanding of each variable.
Q1 - How do the total weights of recorded Atlantic and Pacific Cod landings compare to one another between the years 1950 and 2021?
Plan Q1 - Summarize the data through an area chart or barplot of weight of landings, faceted by “Common_Name”. Also include an animated plot of the same type to better show the fluctuation in landings every 10 years.
Q2 - How do the weights of recorded recreational and commercial Cod landings of the Atlantic and Pacific compare to one another between the years 1950 and 2021?
Plan Q2 - Try an interactive graph. Other possible options to extend the analysis - Merge this data with similar ones for the Tuna fishery between 1950 and 2021. Find data for the same time period of time but for the cod fishery in Canada.
Q3 - How are different states economically benefiting from the cod fishery?
Plan Q3 - Use a density map of the US to represent the money made from the landings (commercial fishing) in different states over a specific year. Possibility to also compare different years (eg: lowest vs highest income)
#install.packages("plotly")
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
cod_landings <- cod_landings %>%
filter(Common_Name != "COD, TOOTHED" ) %>%
filter(Common_Name != "COD, ARCTIC" )
cod_landings_total <- cod_landings %>%
group_by(Year) %>%
mutate(Total_Pounds = sum(Pounds, na.rm = TRUE)) %>%
arrange(desc(Year))
cod_landings_total <- cod_landings_total %>%
mutate(Million_Pounds = Total_Pounds/1000000)
Landings_By_Type_Plotly <- cod_landings_total %>%
group_by(Common_Name) %>%
ggplot(mapping = aes(
x = Year,
y = Million_Pounds,
fill = Fishing_Types)) +
geom_col() +
scale_x_continuous(breaks = seq(1950, 2021, 10))+
labs(title = "Atlantic and Pacific Cod Landings By Fishing Types",
subtitle = "From 1950 to 2021",
x = "Years",
y = "Millions of Pounds",
fill = "Fishing Type")+
facet_wrap( ~ Common_Name, nrow = 2, scales = "free_x")
Landings_By_Type_Plotly <- ggplotly(Landings_By_Type_Plotly)
Landings_By_Type_Plotly
Alt text for visualization: #fig.alt= “Interactive graph of recorded cod landings as a stacked bar chart by commercial and recreational fishing type faceted for the Atlantic and Pacific Cod. The title of this graph is Atlantic and Pacific Cod Landings By Fishing Types, with Years stated on the X-axis, and Millions of Pounds on the Y-axis. There is no record of recreational data for any species before 1980. For the Atlantic cod, there is an overall variation of landings of recreational and commercial fishing over the years. Starting around 2016, the amount of commercial landings decreases at a faster rate than for those of recreational fishing. Before 2016, commercial fishing is more prevalent, with a few years where recreational fishing has higher landings in the early and late 2000’s. For the Pacific cod, there is overall few data of commercial recorded landings before the mid 1990’s. From 2000 to 2021, the rate of landings descreased quicker for commercial landings than for recreational landings”
Other possible options to extend the analysis - Merge this data with similar ones for the Tuna fishery between 1950 and 2021. Find data for the same time period of time but for the cod fishery in Canada.